﻿using System;
using System.Net;
using System.Windows;

namespace Transportr
{
    public class MapMarkerViewModel : BaseItemViewModel
    {
//        private long id;
        private double mLatitude;
        private double mLongitude;
        private string mText;
#if WINDOWS_PHONE
        private System.Device.Location.GeoCoordinate mLocation;

        public System.Device.Location.GeoCoordinate Location
        {
            get
            {
                return new System.Device.Location.GeoCoordinate(mLatitude, mLongitude);
            }
            set
            {
                if (value != mLocation)
                {
                    mLocation = value;
                    NotifyPropertyChanged("Location");
                    NotifyPropertyChanged("Latitude");
                    NotifyPropertyChanged("Longitude");
                }
            }
        }
#endif

        public double Latitude
        {
            get
            {
                return mLatitude;
            }
            set
            {
                if (value != mLatitude)
                {
                    mLatitude = value;
                    NotifyPropertyChanged("Latitude");
                    NotifyPropertyChanged("Location");
                }
            }
        }

        public double Longitude
        {
            get
            {
                return mLongitude;
            }
            set
            {
                if (value != mLongitude)
                {
                    mLongitude = value;
                    NotifyPropertyChanged("Longitude");
                    NotifyPropertyChanged("Location");
                }
            }
        }

        public string Text
        {
            get
            {
                return mText;
            }
            set
            {
                if (value != mText)
                {
                    mText = value;
                    NotifyPropertyChanged("Text");
                }
            }
        }
    }
}
